/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.SmsSendPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.ISmsSendMapper;

@Service
public class SmsSendService {
	@Autowired
	private ISmsSendMapper smsSendMapper;
	
	/**
	 * 根据ID获取SmsSendPo对象
	 * 
	 * @param id
	 * @return
	 * @Author 迷蝶
	 * @return SmsSendPo
	 */
	public SmsSendPo getSmsSend(int id) {
		return smsSendMapper.findSmsSendById(id);
	}
	
	/**
	 * 根据条件获取SmsSendPo对象，并返回查询的数据总数
	 * 
	 * @param smsSend
	 * @Author 迷蝶
	 * @return ResultPageTo<SmsSendPo>
	 */
	public ResultPageTo<SmsSendPo> getSmsSends(SmsSendPo smsSend) {
		return new ResultPageTo<SmsSendPo>(smsSend.getStart(), smsSend.getSize(), 
				smsSendMapper.findSmsSendCount(smsSend), smsSendMapper.findSmsSends(smsSend));
	}
	
	/**
	 * 根据ID删除SmsSendPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delSmsSend(int id) {
		return smsSendMapper.delSmsSendById(id);
	}
	
	/**
	 * 增加SmsSendPo对象
	 * 
	 * @param smsSend
	 * @Author 迷蝶
	 */
	public Integer addSmsSend(SmsSendPo smsSend) {
		return smsSendMapper.addSmsSend(smsSend);
	}
	
	/**
	 * 根据条件更新SmsSendPo对象
	 * 
	 * @param smsSend
	 * @Author 迷蝶
	 */
	public Integer updateSmsSend(SmsSendPo smsSend) {
		return smsSendMapper.updateSmsSend(smsSend);
	}
	
}
